package sistemadeproyectos;

import javax.swing.ImageIcon;
import java.awt.Image;
import javax.swing.JOptionPane;
import java.io.*;

public class MenuPrincipal extends javax.swing.JFrame {

    private Usuario usuarioActivo;
    private Equipo equipoActual;
    
    public void setUsuario(Usuario elUsuario){
        this.usuarioActivo = elUsuario;
    }
    
    public void setEquipo(Equipo elEquipo){
        this.equipoActual = elEquipo;
    }
    
    /** Creates new form MenuPrincipal */
    public MenuPrincipal() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jbtnMapaMental = new javax.swing.JButton();
        jbtnChat = new javax.swing.JButton();
        jbtnRepositorio = new javax.swing.JButton();
        jbtnForo = new javax.swing.JButton();
        jbtnCronograma = new javax.swing.JButton();
        jbtnCalendario = new javax.swing.JButton();
        jlblImagen = new javax.swing.JLabel();
        jbtnEditor = new javax.swing.JButton();
        jbtnUnirseEquipo = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jlblUsuario = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jlblEquipo = new javax.swing.JLabel();
        jbtnCerrarSesion = new javax.swing.JButton();
        jbtnSalir = new javax.swing.JButton();
        jlblAvatar = new javax.swing.JLabel();
        reclamo_button = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sistemadeproyectos.SistemadeproyectosApp.class).getContext().getResourceMap(MenuPrincipal.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N
        setResizable(false);

        jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jbtnMapaMental.setText(resourceMap.getString("jbtnMapaMental.text")); // NOI18N
        jbtnMapaMental.setName("jbtnMapaMental"); // NOI18N
        jbtnMapaMental.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnMapaMentalMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnMapaMentalMouseExited(evt);
            }
        });
        jbtnMapaMental.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnMapaMentalActionPerformed(evt);
            }
        });

        jbtnChat.setText(resourceMap.getString("jbtnChat.text")); // NOI18N
        jbtnChat.setName("jbtnChat"); // NOI18N
        jbtnChat.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnChatMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnChatMouseExited(evt);
            }
        });
        jbtnChat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnChatActionPerformed(evt);
            }
        });

        jbtnRepositorio.setText(resourceMap.getString("jbtnRepositorio.text")); // NOI18N
        jbtnRepositorio.setName("jbtnRepositorio"); // NOI18N
        jbtnRepositorio.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnRepositorioMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnRepositorioMouseExited(evt);
            }
        });
        jbtnRepositorio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnRepositorioActionPerformed(evt);
            }
        });

        jbtnForo.setText(resourceMap.getString("jbtnForo.text")); // NOI18N
        jbtnForo.setName("jbtnForo"); // NOI18N
        jbtnForo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnForoMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnForoMouseExited(evt);
            }
        });
        jbtnForo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnForoActionPerformed(evt);
            }
        });

        jbtnCronograma.setText(resourceMap.getString("jbtnCronograma.text")); // NOI18N
        jbtnCronograma.setName("jbtnCronograma"); // NOI18N
        jbtnCronograma.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnCronogramaMouseExited(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnCronogramaMouseEntered(evt);
            }
        });
        jbtnCronograma.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnCronogramaActionPerformed(evt);
            }
        });

        jbtnCalendario.setText(resourceMap.getString("jbtnCalendario.text")); // NOI18N
        jbtnCalendario.setName("jbtnCalendario"); // NOI18N
        jbtnCalendario.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnCalendarioMouseExited(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnCalendarioMouseEntered(evt);
            }
        });
        jbtnCalendario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnCalendarioActionPerformed(evt);
            }
        });

        jlblImagen.setText(resourceMap.getString("jlblImagen.text")); // NOI18N
        jlblImagen.setName("jlblImagen"); // NOI18N

        jbtnEditor.setText(resourceMap.getString("jbtnEditor.text")); // NOI18N
        jbtnEditor.setName("jbtnEditor"); // NOI18N
        jbtnEditor.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnEditorMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnEditorMouseExited(evt);
            }
        });
        jbtnEditor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnEditorActionPerformed(evt);
            }
        });

        jbtnUnirseEquipo.setText(resourceMap.getString("jbtnUnirseEquipo.text")); // NOI18N
        jbtnUnirseEquipo.setName("jbtnUnirseEquipo"); // NOI18N
        jbtnUnirseEquipo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnUnirseEquipoMouseExited(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnUnirseEquipoMouseEntered(evt);
            }
        });
        jbtnUnirseEquipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnUnirseEquipoActionPerformed(evt);
            }
        });

        jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jlblUsuario.setFont(resourceMap.getFont("jlblUsuario.font")); // NOI18N
        jlblUsuario.setText(resourceMap.getString("jlblUsuario.text")); // NOI18N
        jlblUsuario.setName("jlblUsuario"); // NOI18N

        jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jlblEquipo.setFont(resourceMap.getFont("jlblEquipo.font")); // NOI18N
        jlblEquipo.setText(resourceMap.getString("jlblEquipo.text")); // NOI18N
        jlblEquipo.setName("jlblEquipo"); // NOI18N

        jbtnCerrarSesion.setText(resourceMap.getString("jbtnCerrarSesion.text")); // NOI18N
        jbtnCerrarSesion.setName("jbtnCerrarSesion"); // NOI18N
        jbtnCerrarSesion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnCerrarSesionMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnCerrarSesionMouseExited(evt);
            }
        });
        jbtnCerrarSesion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnCerrarSesionActionPerformed(evt);
            }
        });

        jbtnSalir.setText(resourceMap.getString("jbtnSalir.text")); // NOI18N
        jbtnSalir.setName("jbtnSalir"); // NOI18N
        jbtnSalir.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbtnSalirMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbtnSalirMouseExited(evt);
            }
        });
        jbtnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnSalirActionPerformed(evt);
            }
        });

        jlblAvatar.setText(resourceMap.getString("jlblAvatar.text")); // NOI18N
        jlblAvatar.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
        jlblAvatar.setName("jlblAvatar"); // NOI18N

        reclamo_button.setText(resourceMap.getString("reclamo_button.text")); // NOI18N
        reclamo_button.setName("reclamo_button"); // NOI18N
        reclamo_button.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                reclamo_buttonMouseExited(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                reclamo_buttonMouseEntered(evt);
            }
        });
        reclamo_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reclamo_buttonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(128, 128, 128))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jlblImagen, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jbtnSalir, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jbtnEditor, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                                    .addComponent(jbtnRepositorio, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                                    .addComponent(jbtnMapaMental, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                                    .addComponent(jbtnChat, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                                    .addComponent(reclamo_button, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jbtnCerrarSesion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jbtnForo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jbtnCronograma, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jbtnCalendario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jbtnUnirseEquipo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addGap(57, 57, 57)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(34, 34, 34)
                        .addComponent(jlblAvatar, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jlblEquipo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jlblUsuario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jlblAvatar, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jlblUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jlblEquipo, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(19, 19, 19))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(26, 26, 26)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jbtnForo)
                                    .addComponent(jbtnMapaMental))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jbtnCronograma)
                                    .addComponent(jbtnChat))
                                .addGap(16, 16, 16)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jbtnRepositorio)
                                    .addComponent(jbtnCalendario))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jbtnEditor)
                                    .addComponent(jbtnUnirseEquipo))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(reclamo_button)
                                    .addComponent(jbtnCerrarSesion)))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jlblImagen, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(24, 24, 24)))
                        .addGap(18, 18, 18)
                        .addComponent(jbtnSalir)
                        .addGap(65, 65, 65))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    public void info(){
        this.jlblEquipo.setText(this.equipoActual.getIdEquipo());
        this.jlblUsuario.setText(this.usuarioActivo.getUsuario());
        jlblAvatar.setIcon(ajustarImagen(this.usuarioActivo.getURL_Avatar(), jlblAvatar.getWidth(), jlblAvatar.getHeight()));
    }
    
    private ImageIcon ajustarImagen(String ico, int ancho, int alto) {
        ImageIcon tmpIconAux = new ImageIcon(ico);
        //Escalar Imagen
        ImageIcon tmpIcon = new ImageIcon(tmpIconAux.getImage().getScaledInstance(ancho, alto, Image.SCALE_DEFAULT));
        return tmpIcon;
    }
    
    private void mostrarImagen(String imagen){
        if(System.getProperty("os.name").substring(0,5).equals("Windo")){
            jlblImagen.setIcon(ajustarImagen(System.getProperty("user.dir") + "\\src\\sistemadeproyectos\\images\\" + imagen + ".jpg", jlblImagen.getWidth(), jlblImagen.getHeight()));
        }
        else if(System.getProperty("os.name").substring(0,5).equals("Linux")){
            jlblImagen.setIcon(ajustarImagen(System.getProperty("user.dir") + "/src/sistemadeproyectos/images/" + imagen + ".jpg", jlblImagen.getWidth(), jlblImagen.getHeight()));
        }
    }
    
    private void jbtnMapaMentalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnMapaMentalActionPerformed
        // TODO add your handling code here:
        try{
            MapaMental mapa = new MapaMental(this.usuarioActivo, this.equipoActual);
            mapa.setVisible(true);
            mapa.reconstruirMapa();
        }
        catch(IOException nomapa){}
    }//GEN-LAST:event_jbtnMapaMentalActionPerformed

    private void jbtnMapaMentalMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnMapaMentalMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Mapa");
    }//GEN-LAST:event_jbtnMapaMentalMouseEntered

    private void jbtnMapaMentalMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnMapaMentalMouseExited
        // TODO add your handling code here:
        
    }//GEN-LAST:event_jbtnMapaMentalMouseExited

    private void jbtnChatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnChatActionPerformed
        // TODO add your handling code here:
        try {
            ConexionChat conecta = new ConexionChat((this.usuarioActivo), (this.equipoActual));
            conecta.setVisible(true);
        } catch (Exception e) {
            JOptionPane.showMessageDialog(this, "Error al establecer conexion con servidor de chat."
                , "Error en Conexion", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jbtnChatActionPerformed

    private void jbtnChatMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnChatMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Chat");
    }//GEN-LAST:event_jbtnChatMouseEntered

    private void jbtnChatMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnChatMouseExited
        // TODO add your handling code here:
       
    }//GEN-LAST:event_jbtnChatMouseExited

    private void jbtnRepositorioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnRepositorioActionPerformed
        try {
            RepositorioCliente repositorio = new RepositorioCliente(this.equipoActual, this.usuarioActivo);
            repositorio.setVisible(true);
        } 
        catch (Exception e) { 
                JOptionPane.showMessageDialog(this, "Error al establecer conexion con servidor de repositorio."
                        ,"Error en Conexion", JOptionPane.ERROR_MESSAGE);
        }        
    }//GEN-LAST:event_jbtnRepositorioActionPerformed

    private void jbtnRepositorioMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnRepositorioMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Repositorio");
    }//GEN-LAST:event_jbtnRepositorioMouseEntered

    private void jbtnRepositorioMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnRepositorioMouseExited
        // TODO add your handling code here:
    }//GEN-LAST:event_jbtnRepositorioMouseExited

    private void jbtnForoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnForoActionPerformed
        // TODO add your handling code here:
        VerHilosForo foro = new VerHilosForo((this.usuarioActivo), (this.equipoActual));
        foro.setVisible(true);
    }//GEN-LAST:event_jbtnForoActionPerformed

    private void jbtnForoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnForoMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Foro");
    }//GEN-LAST:event_jbtnForoMouseEntered

    private void jbtnForoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnForoMouseExited
        // TODO add your handling code here:
        
    }//GEN-LAST:event_jbtnForoMouseExited

    private void jbtnCronogramaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnCronogramaMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Diagrama");
    }//GEN-LAST:event_jbtnCronogramaMouseEntered

    private void jbtnCronogramaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnCronogramaMouseExited
        // TODO add your handling code here:
        
    }//GEN-LAST:event_jbtnCronogramaMouseExited

    private void jbtnCalendarioMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnCalendarioMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Calendario");
    }//GEN-LAST:event_jbtnCalendarioMouseEntered

    private void jbtnCalendarioMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnCalendarioMouseExited
        // TODO add your handling code here:
        
    }//GEN-LAST:event_jbtnCalendarioMouseExited

    private void jbtnUnirseEquipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnUnirseEquipoActionPerformed
        // TODO add your handling code here:
        UnirseEquipo unir = new UnirseEquipo();
        unir.setVisible(true);
        unir.setUsuario(this.usuarioActivo);
        this.dispose();
    }//GEN-LAST:event_jbtnUnirseEquipoActionPerformed

    private void jbtnUnirseEquipoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnUnirseEquipoMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Equipo");
    }//GEN-LAST:event_jbtnUnirseEquipoMouseEntered

    private void jbtnUnirseEquipoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnUnirseEquipoMouseExited
        // TODO add your handling code here:
        
    }//GEN-LAST:event_jbtnUnirseEquipoMouseExited

    private void jbtnEditorMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnEditorMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Texto");
    }//GEN-LAST:event_jbtnEditorMouseEntered

    private void jbtnEditorMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnEditorMouseExited
        // TODO add your handling code here:
        
    }//GEN-LAST:event_jbtnEditorMouseExited

    private void jbtnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnSalirActionPerformed
        // TODO add your handling code here:
        int seleccion = JOptionPane.showOptionDialog(
        this, // Componente padre
        "¿Desea salir del sistema?", //Mensaje
        "Salir", // Título
        JOptionPane.YES_NO_CANCEL_OPTION,
        JOptionPane.QUESTION_MESSAGE,
        null,    // null para icono por defecto.
        new Object[] { "Si", "No"}, // null para YES, NO y CANCEL
        "Si");
        if(seleccion == 0){
            System.exit(0);
        }
    }//GEN-LAST:event_jbtnSalirActionPerformed

    private void jbtnSalirMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnSalirMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Salir");
    }//GEN-LAST:event_jbtnSalirMouseEntered

    private void jbtnSalirMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnSalirMouseExited
        // TODO add your handling code here:
        
    }//GEN-LAST:event_jbtnSalirMouseExited

    private void jbtnCerrarSesionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnCerrarSesionActionPerformed
        // TODO add your handling code here:
        int seleccion = JOptionPane.showOptionDialog(
        this, // Componente padre
        "¿Desea cerrar Sesión?", //Mensaje
        "Cerrar Sesión", // Título
        JOptionPane.YES_NO_CANCEL_OPTION,
        JOptionPane.QUESTION_MESSAGE,
        null,    // null para icono por defecto.
        new Object[] { "Si", "No"}, // null para YES, NO y CANCEL
        "Si");
        if(seleccion == 0){
            InicioSesion regreso = new InicioSesion();
            regreso.setVisible(true);
            this.dispose();
        }
    }//GEN-LAST:event_jbtnCerrarSesionActionPerformed

    private void jbtnCerrarSesionMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnCerrarSesionMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Cerrar");
    }//GEN-LAST:event_jbtnCerrarSesionMouseEntered

    private void jbtnCerrarSesionMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbtnCerrarSesionMouseExited
        // TODO add your handling code here:
        
    }//GEN-LAST:event_jbtnCerrarSesionMouseExited

private void jbtnCalendarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnCalendarioActionPerformed
    UseJCalendar cal = new UseJCalendar(this.equipoActual.getIdEquipo());
    cal.setVisible(true);
}//GEN-LAST:event_jbtnCalendarioActionPerformed

    private void jbtnEditorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnEditorActionPerformed
        Editor editortexto = new Editor();
        editortexto.setVisible(true);
    }//GEN-LAST:event_jbtnEditorActionPerformed

    private void reclamo_buttonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reclamo_buttonMouseEntered
        // TODO add your handling code here:
        mostrarImagen("Reclamo");
    }//GEN-LAST:event_reclamo_buttonMouseEntered

    private void reclamo_buttonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reclamo_buttonMouseExited
        // TODO add your handling code here:
        
    }//GEN-LAST:event_reclamo_buttonMouseExited

    private void reclamo_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reclamo_buttonActionPerformed
        CrearReclamo reclamo = new CrearReclamo(usuarioActivo, equipoActual);
        reclamo.setVisible(true);
    }//GEN-LAST:event_reclamo_buttonActionPerformed

private void jbtnCronogramaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnCronogramaActionPerformed
    Diagrama cron = new Diagrama("Cronograma", this.equipoActual.getIdEquipo());
}//GEN-LAST:event_jbtnCronogramaActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MenuPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JButton jbtnCalendario;
    private javax.swing.JButton jbtnCerrarSesion;
    private javax.swing.JButton jbtnChat;
    private javax.swing.JButton jbtnCronograma;
    private javax.swing.JButton jbtnEditor;
    private javax.swing.JButton jbtnForo;
    private javax.swing.JButton jbtnMapaMental;
    private javax.swing.JButton jbtnRepositorio;
    private javax.swing.JButton jbtnSalir;
    private javax.swing.JButton jbtnUnirseEquipo;
    private javax.swing.JLabel jlblAvatar;
    private javax.swing.JLabel jlblEquipo;
    private javax.swing.JLabel jlblImagen;
    private javax.swing.JLabel jlblUsuario;
    private javax.swing.JButton reclamo_button;
    // End of variables declaration//GEN-END:variables
}
